package com.genia.toolbox.projects.sample_ws_trampo.war.ws.interceptor;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.interceptor.StaxOutInterceptor;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;

public class CatchOutInterceptor extends AbstractPhaseInterceptor<Message> {

	public CatchOutInterceptor(String phase) {
		super(phase);
		addBefore(StaxOutInterceptor.class.getName());
	}

	public CatchOutInterceptor() {
		this(Phase.PRE_STREAM);
	}

	public void handleMessage(Message message) throws Fault {
		ReadOutInterceptor roi = new ReadOutInterceptor(message);
		roi.logging();
	}
}